<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * @author Thanh Nguyen Dinh <thanhnguyendinh@admicro.vn>
 * @copyright 2013
 */

class Default_Layout
{
    private $_CI;

    function __construct()
    {
        $this->_CI =& get_instance();
        $this->_CI->load->library('Minifier');
		$this->_CI->load->library('Mycommon');
		//$this->_CI->load->model('user/user_model');		
    }
    
    public function _loadHeader($headTitle = '')
    {
        $data = array();
        $this->_CI->config->load('config_info');         
        $configInfo = $this->_CI->config->item('infoWebsite');
        $data['headTitle'] = ($headTitle != '') ? $headTitle : $configInfo['headTitle'];
        $data['metaTitle'] = $configInfo['metaTitle'];
        $data['metaKeyword'] = $configInfo['metaKeyword'];
        $data['metaDesc'] = $configInfo['metaDesc'];
        $this->addCssJs();
        $data['combinedCss'] = $this->_CI->minifier->GetCombined('css');
        $data['combinedJs'] = $this->_CI->minifier->GetCombined('js');
        $data['rsegment'] = $this->_CI->uri->rsegment(1);
       	$this->_CI->load->view('header_view', $data);
    }
    
    public function _loadFooter()
    {
        $this->_CI->load->view('footer_view');
    }
    
    private function addCssJs()
    {
        $this->_CI->minifier->AddCss('nivo-slider');
        $this->_CI->minifier->AddCss('main');
        $this->_CI->minifier->AddJs('jquery-1.7.2.min');
        $this->_CI->minifier->AddJs('jquery-ui-1.8.22.custom.min');
        $this->_CI->minifier->AddJs('jquery.validate');
    }

}

?>
